﻿package
{
	import flash.display.Sprite;
	import flash.filters.GradientBevelFilter;
	import flash.display.GradientType;
	import flash.geom.Matrix;

	public class ball extends Sprite
	{
		public var vx:Number=0;
		public var vy:Number=0;
		public var radius:Number;
		public var color:uint;

		public var mass:Number=1;

		public function ball(radius:Number=20, color:uint=0xff0000)
		{
			this.radius=radius;
			this.color=color;
			init();
		}

		private function init():void
		{

			var fillType:String=GradientType.RADIAL;
			var colors:Array=[0xfffffff, color];
			var alphas:Array=[1, 1];
			var ratios:Array=[1, 255];
			var matr:Matrix=new Matrix();
			matr.createGradientBox(20, 20, 0, 0, 0);

			graphics.beginGradientFill(GradientType.RADIAL, colors, alphas, ratios, matr);

			graphics.drawCircle(0, 0, this.radius);
			graphics.endFill();
		}
	}
}
